template <typename Iterator,typename T>
T accumulate_1(Iterator first,Iterator last,T value){
	while(first != last){
		value = value + *first;
		++first;
	}
	return value;
}
template <typename Iterator,typename T,typename BinaryOperation>
T accumulate_1(Iterator first,Iterator last,T value,BinaryOperation op){
	while (first != last){
		value = op(value,*first);
		++first;
	}
	return value;
}

template <typename Iterator1,typename Iterator2,typename T>
T inner_product_1(Iterator1 first1,Iterator1 last1,Iterator2 first2, T value){
	while (first1 != last1){
		value = value + *first1 * *first2;
		++first1;
		++first2;
	}
	return value;
}

template <typename Iterator1,typename Iterator2,typename T,typename BinaryOperation1,typename BinaryOperation2>
T inner_product_1(Iterator1 first1,Iterator1 last1,Iterator2 first2,T value,BinaryOperation1 op1,BinaryOperation2 op2){
	while (first1 != last1){
		value = op1(value,op2(*first1,*first2)); 
		++first1;
		++first2;
	}
	return value;
}

template <typename Iterator1,typename Iterator2>
Iterator2 partial_sum_1(Iterator1 first,Iterator1 last,Iterator2 result){
	if (first == last) return result;
	*result = *first;
	typename std::iterator_traits<Iterator1>::value_type value = *first;
	while (++first != last){
		value = value + *first;
		*++result = value;
	}
	return ++result;
}

template <typename Iterator1,typename Iterator2,typename BinaryOperation>
Iterator2 partial_sum_1(Iterator1 first,Iterator1 last,Iterator2 result,BinaryOperation op){
	if (first == last) return result;
	*result = *first;
	typename std::iterator_traits<Iterator1>::value_type value = *first;
	while (++first != last){
		value = op(value,*first);
		*++result = value;
	}
	return ++result;
}

template <typename Iterator1,typename Iterator2>
Iterator2 adjacent_difference_1(Iterator1 first,Iterator1 last,Iterator2 result){
	if (first == last) return result;
	*result = *first;
	typedef typename std::iterator_traits<Iterator1>::value_type value_type;
   value_type value = *first;
	while (++first != last){
		value_type tmp = *first;
		*++result = tmp - value;
		value = tmp;
	}
	return ++result;
}

template <typename Iterator1,typename Iterator2,typename BinaryOperation>
Iterator2 adjacent_difference_1(Iterator1 first,Iterator1 last,Iterator2 result,BinaryOperation op){
	*result = *first;
	typedef typename std::iterator_traits<Iterator1>::value_type value_type;
	value_type value = *first;
	while (++first != last){
		value_type tmp = *first;
		*result = op(tmp,value);
		value = tmp;
	}
	return ++result;
}

